(function ($) {
    var methods = {
        init: function (options) {
// this
            console.log(options)
        },
        show: function () {
// is
        },
        hide: function () {
// good
        },
        update: function (options) {
// !!!
            console.log(options)
        }
    };
    $.fn.tooltip = function (method) {
// 方法调用
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return methods.init.apply(this, arguments);
        } else {
            $.error('Method' + method + 'does not exist on jQuery.tooltip');
        }
    };
})(jQuery);